package testGame;

/**
 * @author Cheung Oi Kwan 
 */

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import satirGame.Stage;

public class StageTest {
	Stage TestStage = new Stage();
	@Before
	public void setUp() throws Exception {
		Stage.setNumPlayer(3);
		String name="John";
		TestStage.resetCurPlayer(0);
		TestStage.playerArray.get(TestStage.getCurPlayer()).setName(name);
		name="Ken";
		TestStage.resetCurPlayer(1);
		TestStage.playerArray.get(TestStage.getCurPlayer()).setName(name);
		name="Ann";
		TestStage.resetCurPlayer(2);
		TestStage.playerArray.get(TestStage.getCurPlayer()).setName(name);
	}

	@Test
	public void testIsCorrectPlayer() {
		int result=0;
		String name="John";
		assertEquals(name, TestStage.playerArray.get(result).getName());
		
	}
	@Test 
	public void testGetCurrentPlayer(){
		int curPlayer=1;
		int result=0;
		TestStage.resetCurPlayer(curPlayer);
		result = TestStage.getCurPlayer();
		assertEquals(curPlayer, result);		
	}
	
   
   @Test
	public void testGetRound(){
	int Roundnum = 5;
	int result = 0;
	TestStage.setRemainRound(Roundnum);
	TestStage.minusRemainRound();
	result = TestStage.getRemainRound();
	assertEquals(Roundnum-1, result);
   }

}

/*----------------Version detail----------------------------

Modified time: 18:27_13/03/2012

Editor: Cheung Oi Kwan

Content: 

Add testGetCurrentPlayer(),testCorrectCurrentPlayer() Test Case, testSetGrayGrid()Test Case,
testGetRound() Test case
-----------------------------------------------------------*/
